Skip to content

server: publish every engine step on GET /engine/steps (continuum 4.10 P5 slice 1) - #119

Closed
joelteply wants to merge 3 commits into
continuum-pin/b5534b5from
fable/engine-steps
Closed

joelteply wants to merge 3 commits into
continuum-pin/b5534b5from
fable/engine-steps

Conversation

@joelteply

Copy link
Copy Markdown

Producer half of continuum ggml-org#6055; the core reader is continuum ggml-org#6059. Separate stream beside /learn/events; one subscriber, ring bound set by the subscriber (?capacity=N), began/ended records per update_slots step, loss published in position as 'missed'. Based on the pinned b5534b5 (continuum canary's submodule). Not compiled locally (the serving M5 never builds beside serving); this PR's CI is the compile.

🤖 Generated with Claude Code

…0 P5 slice 1)

A second, separate stream beside /learn/events (never through it: that one delivers terminal
mutations to one subscriber). One subscriber; it names the ring's bound (?capacity=N, its memory
to spend; none is refused, never defaulted). The stream opens with {engine, origin_us}; update_slots
records 'began' {step, at_us, chosen tasks} once the batch is rendered and 'ended' {step, at_us,
work[]} after post_decode: per task its depth before the step, prompt tokens prefilled, tokens
decoded (the slot's counter delta, or the tokens it generated in the batch when the task finished
inside the step and its counters reset) and accepted drafts (null when unknowable for that reason).
Writing never blocks the task loop; a full ring counts what it lost and publishes it in position as
one 'missed' record. With no subscriber nothing is recorded.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit to CambrianTech/continuum that referenced this pull request Nov 16, 2026
…em; the subscriber names the ring's bound (capacity), matching the fork's /engine/steps (CambrianTech/llama.cpp#119)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply
joelteply changed the base branch from 889580fc/seq-state-across-stream-counts to continuum-pin/b5534b5 November 16, 2026 03:37
joelteply and others added 2 commits November 15, 2026 21:44
…am are both a response generator)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…uint64_t on every platform)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit to CambrianTech/continuum that referenced this pull request Nov 16, 2026
…ure (#6059)

* P5 slice 1, core side: the fork's /engine/steps stream recorded into the capture on the core's clock (#6055)

- continuum-engine::inference::workload::steps::record_steps reads one engine incarnation's step
  stream (SSE, typed once at the process boundary): opened {origin_us}, began/ended steps,
  sequence changes with the mind, and missed {count}.
- The engine's monotonic time maps onto the core's Instant once, at the opening record, so every
  record keeps the order and spacing it happened with.
- A 'missed' record and a gap in the sequence numbers both reach the sink as loss
  (CaptureSink::missed, new; Ring counts it in Missing::dropped), so that interval cannot gate.
- A stream that never states its origin ends NoOrigin; an unreadable record ends Unreadable.

Tests against a fake engine: typed events in order with the engine's 5 ms spacing kept; engine
loss plus a sequence gap void the interval; no origin refuses. The fork side is #6055's other half.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Step stream: an unreadable record carries its typed serde error, not a string

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Step stream: accepted drafts are None when the engine cannot count them; the subscriber names the ring's bound (capacity), matching the fork's /engine/steps (CambrianTech/llama.cpp#119)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

* Step stream: typed ends (transport error, refused status), no error formatted into a string

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@joelteply

Copy link
Copy Markdown
Author

Review of exact e0352da: not accepted as the P5 replay source yet.

  1. Tail loss can disappear. push() emits lost only on a subsequent push; after a full ring, if the engine becomes idle, draining existing records never emits the loss. close() clears the queue without a terminal watermark. Flush pending loss through the reader/finalization owner and require a terminal sequence watermark; a drop followed by idle/disconnect must not yield a complete recording.
  2. Subscription is not atomic with engine-step/lifecycle state. This patch emits began/ended but no sequence arrival/ready/blocked/completed/cancelled records or initial live/open-step snapshot. Subscribing while work is active therefore cannot reconstruct the ready set, starvation, or initial task state required by the accepted design. Add typed lifecycle coverage and atomic initial state, or explicitly reject incomplete-prefix captures from the gate.
  3. The producer is described as nonblocking but takes the same mutex that next_frame holds during JSON dump/string allocation. Move serialization outside the lock and measure capture-on/off step latency under slow-reader/full-buffer load. A record-count bound also needs a measured byte budget for variable-width chosen/work records.

Coordinate this with continuum ggml-org#6059's identity validation and finalization review before the pin bump. No native performance or deployment approval is implied.

@joelteply

Copy link
Copy Markdown
Author

Superseded by #132: the same stream on codex/s4-per-mind-integration; the loop now copies typed fields into a preallocated ring (no JSON or map per step), frames unchanged.

@joelteply joelteply closed this Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant